import 'dart:io';

import 'package:animal/utils/sputils/sp_config.dart';

///消息model
class MessageModel {
  ///登录Model
  static Map loginModel() {
    return {
      "pf": Platform.isAndroid ? 2 : 3,
      "av": SpConfig().deviceVersion,
      "di": "${SpConfig().getAndroidProduct()}_${SpConfig().getUserId()}",
    };
  }

  ///消息Model
  static Map messageModel({
    String? messageID,
    String? sendUser,
    String? sendName,
    String? sendHead,
    String? receive,
    String? receiveRelation,
    String? sendTime,
    String? messageType,
    String? messageContent,
    String? url,
    double? imageWidth,
    double? imageHeight,
    String? audioTime,
    String? fi,
    String? userType,
  }) {
    return {
      "m": {
        "i": messageID,
        "f": sendUser,
        "fn": sendName,
        "fh": sendHead,
        "t": receive,
        "tt": receiveRelation,
        "st": sendTime,
        "mt": messageType,
        "c": messageContent,
        "u": url,
        "w": imageWidth,
        "h": imageHeight,
        "fi": fi,
        "vt": audioTime,
        "ut": userType,
      }
    };
  }

  ///群消息model
  static Map groupModel({
    String? option,
    String? groupID,
    String? groupName,
    String? groupHead,
  }) {
    return {
      "op": option,
      "gi": groupID,
      "gn": groupName,
      "gh": groupHead,
    };
  }

  ///心跳model
  static Map heartModel({
    String? uUID,
    int? state,
    int? offLineMessageNum,
  }) {
     return {
       "mhb": {
         "i": uUID,
         "s": state,
         "om": offLineMessageNum
       }
    };
  }

  ///红包model
  static Map redPacketModel({
    String? state,
    double? money,
  }) {
    return {
      "mhb": {
        "c": state,
        "m": money,
      }
    };
  }

  ///用户model
  static Map userModel({
    String? cID,
    String? cName,
    String? cHead,
  }) {
    return {
      "c": {
        "ci": cID,
        "cn": cName,
        "ch": cHead,
      }
    };
  }

  ///商品model
  static Map goodsModel({
    String? goodsID,
    String? goodsName,
    String? goodsTitle,
    String? goodsDescribe,
    String? goodsPrice,
  }) {
    return {
      "g": {
        "gId": goodsID,
        "gImg": goodsName,
        "gt": goodsTitle,
        "gd": goodsDescribe,
        "gp": goodsPrice,
      }
    };
  }

  ///申请model
  static Map applyModel({
    String? applyID,
    String? applyNickName,
    String? applyHead,
    String? applyContent,
    String? applyTime,
  }) {
    return {
      "fa": {
        "i": applyID,
        "nk": applyNickName,
        "h": applyHead,
        "c": applyContent,
        "it": applyTime,
      }
    };
  }

  ///邀请model
  static Map invitationModel({
    String? invitationID,
    String? invitationMsgID,
    String? invitationSendUserID,
    String? invitationSendUserNickName,
    String? invitationSendUserHead,
    String? invitationGroupID,
    String? invitationGroupName,
    String? invitationGroupHead,
    String? invitationTime,
  }) {
    return {
      "gi": {
        {
          "i": invitationID,
          "a": invitationMsgID,
          "f": invitationSendUserID,
          "fn": invitationSendUserNickName,
          "fh": invitationSendUserHead,
          "gi": invitationGroupID,
          "gn": invitationGroupName,
          "gh": invitationGroupHead,
          "it": invitationTime,
        }
      }
    };
  }

  ///邀请model
  static Map gnModel({
    String? gn_ID, //消息ID
    String? gn_uID, //消息来源ID
    String? gn_un, //用户名
    String? gn_fh, //用户头像
    String? gn_t, //消息接收方
    String? gn_tt, //消息接收类型（0 好友 1）
    String? gn_nt, //群通知类型
    String? gn_nk, //通知key
    String? gn_ut, //用户类型
    String? gn_gi, //群ID
    String? gn_gn, //群头像
    String? gn_gh, //描述
    String? gn_c, //描述
    String? gn_fn, //好友昵称
    String? gn_st, //邀请时间
  }) {
    return {
      "gn": {
        "id": gn_ID,
        "ui": gn_uID,
        "un": gn_un,
        "fh": gn_fh,
        "t": gn_t,
        "tt": gn_tt,
        "nt": gn_nt,
        "nk": gn_nk,
        "ut": gn_ut,
        "gi": gn_gi,
        "gn": gn_gn,
        "gh": gn_gh,
        "c": gn_c,
        "fn": gn_fn,
        "st": gn_st,
      }
    };
  }

  ///错误消息
  static Map mrModel({
    String? mr_i, //发送ID
    String? mr_si, //消息对应的服务ID
    String? mr_c, //错误编码
    String? mr_m, //错误描述信息
    String? mr_e, //错误描述是否给用户：1提示、0不提示
  }) {
    return {
      "mr": {
        "i": mr_i,
        "si": mr_si,
        "c": mr_c,
        "m": mr_m,
        "e": mr_e,
      }
    };
  }

  ///错误消息
  static Map snModel({
    String? sn_i, //发送ID
    String? sn_u, //用户ID
    String? sn_t, //标题
    String? sn_nt, //系统通知类型
    String? sn_e, //事件ID
    String? sn_c, //通知内容Key
    String? sn_st, //错误描述是否给用户：1提示、0不提示
    String? sn_c_n, //通知内容key
    String? sn_c_v, //通知内容值
    String? sn_h_c, //居中
    String? sn_h_v, //通知内容值
    String? sn_h_co, //展示颜色
    String? sn_h_b, //是否加粗
  }) {
    return {
      "sn": {
        "i": sn_i,
        "u": sn_u,
        "t": sn_t,
        "nt": sn_nt,
        "e": sn_e,
        "c": {
          "n": sn_c_n,
          "v": sn_c_v,
        },
        "st": sn_st,
        "h": {
          "c": sn_h_c,
          "v": sn_h_v,
          "co": sn_h_co,
          "b": sn_h_b,
        },
      }
    };
  }

  ///错误消息
  static Map mcModel({
    String? mc_ei, //结束ID
    String? mc_i, //单个ID
    String? mc_ids, //多个ID
    String? mc_rsi, //区间ID开始值
    String? mc_red, //区间ID结束值
    String? mc_dk, //删除缓存key
  }) {
    return {
      "mc": {
        "ei": mc_ei,
        "i": mc_i,
        "ids": mc_ids,
        "rsi": mc_rsi,
        "red": mc_red,
        "dk": mc_dk,
      },
    };
  }
}
